#!/usr/bin/python
# -*- coding: UTF-8 -*-

import MySQLdb

conn = MySQLdb.connect(
    host="127.0.0.1",
    port=3306,
    user="root",
    passwd="123456",
    db="a-star",
    charset="utf8"
)

cursor = conn.cursor()

sql = "select * from map"

try:
    cursor.execute(sql)
    results = cursor.fetchall()
    for row in results:
        print(row)
except Exception as e:
    print(e)
finally:
    conn.close()
